<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<div><spring:message code="console.webapp.label.book"/></div>
<form:form modelAttribute="book">
    <form:hidden path="id"/>
    <form:hidden path="createdDate"/>
    <form:hidden path="lastUpdateDate"/>
    <table>
        <tr>
            <td><spring:message code="console.webapp.label.title"/></td>
            <td><form:input path="title"/> <form:errors path="title"/></td>
        </tr>
        <tr>
            <td><spring:message code="console.webapp.label.description"/></td>
            <td><form:textarea path="description"/> <form:errors path="description"/></td>
        </tr>
        <tr>
            <td><spring:message code="console.webapp.label.authors"/></td>
            <td><form:select path="authors" multiple="true" items="${allAuthors}" itemValue="id" itemLabel="fullName" /></td>
        </tr>
        <tr>
            <td><spring:message code="console.webapp.label.categories"/></td>
            <td><form:select path="category" items="${allCategories}" itemValue="id" itemLabel="name" /></td>
        </tr>
        <tr>
            <td><input type="reset"/></td>
            <td><input type="submit"/></td>
        </tr>
    </table>
</form:form>